<template>
  <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" center :before-close="handleClose">
    <span slot="title"></span>
    <audio controls :src="url"></audio>
  </el-dialog>
</template>

<script setup>
import { ref } from 'vue';

// 响应式数据
const dialogVisible = ref(false);
const url = ref("");

// 方法
const show = (audioUrl) => {
    dialogVisible.value = true;
    url.value = audioUrl;
};

const handleClose = () => {
    dialogVisible.value = false;
};

// 导出方法
defineExpose({
    show
});
</script>

<style lang="scss" scoped>
</style>